<?php
/**
 * This file is part of Very Light MVC Framework
 * 
 * Very Light MVC Framework is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.

 * Very Light MVC Framework is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with Very Light MVC Framework.  If not, see <http://www.gnu.org/licenses/>
 *
 * PHP VERSION 5
 *
 * @category  FrontEnd
 * @package   VLMVC
 * @author    Ignacio R. Galieri <irgalieri@gmail.com>
 * @copyright 2011 Ignacio R. Galieri
 * @license   GNU GPL v3
 * @link      http://ar.linkedin.com/pub/ignacio-rodrigo-galieri/a/22/bb2
 */

/**
 * Convert Array to Object
 *
 * @param mixed $element element
 * 
 * @return Object
 */
function array2Object($element)
{
    if (is_array($element)) {
        return (object) array_map(__FUNCTION__, $element);
    } else {
        return $element;
    }
}

/**
 * Convert Object to Array
 *
 * @param mixed $element Element
 * 
 * @return array
 */
function object2Array($element)
{
    if (is_object($element)) {
        $element = get_object_vars($element);
    }
    if (is_array($element)) {
        return array_map(__FUNCTION__, $element);
    } else {
        return $element;
    }
}

/**
 * Return de instance of Controller Class
 *
 * @return Controller
 */
function getInstance()
{
    return Controller::getInstance();
}

/**
 * Return de instance of Config Class
 *
 * @return Config
 */
function getConfig()
{
    return Config::getInstance();
}
?>